import 'dart:io';

import 'package:flutter/material.dart';

void main() {
  runApp(new RichTextPlugin());
}

/*
 * 富文本 <br/>
 * 需要传入的键：<br/>
 * 传入的值类型： <br/>
 * 传入的值含义：<br/>
 * 是否必传 ：
 */
class RichTextPlugin extends StatefulWidget {
  State<StatefulWidget> createState() {
    return new RichTextPluginState();
  }
}

/*
 * 页面功能 <br/>
 */
class RichTextPluginState extends State<StatefulWidget> {
  void initState() {
    super.initState();
  }

  Widget build(BuildContext context) {
    AppBar appBar =  AppBar(
      leading: new IconButton(
        icon: new Icon(Icons.arrow_back),
        onPressed: () {},
      ),
      title: new Text('FlutterDesign'),
      centerTitle: true,
      actions: <Widget>[
        new Container(width: 0, height: 0),
        new Container(width: 0, height: 0),
      ],
      backgroundColor: Colors.blue,
    );

    return  MaterialApp(
      home: new Scaffold(
        appBar: appBar,
        body: new Builder(builder: (BuildContext context)
        {
          return  RichText(
            text: TextSpan(
              text: '《Flutter 练习》',
              style: TextStyle(
                fontSize: 30,
                color: Colors.black,
              ),
              children: <TextSpan>[
                TextSpan(
                    text: 'Steven', style: TextStyle(fontSize: 16, color: Colors.blue)),
                TextSpan(
                    text: 'Steven', style: TextStyle(fontSize: 16, color: Colors.blue)),
              ],
            ),
          );
        }),
        backgroundColor: Colors.red,
        bottomNavigationBar: null,
      ),
    );
  }
}
